package com.java.util;

public class StringEncrypter {
	private static final int SHIFT_KEY = 5;

	/**
	 * encrypt text
	 **/
	public static String encrypt(String text) {
		StringBuilder encryptedText = new StringBuilder();
		for (char c : text.toCharArray()) {
			encryptedText.append((char) (c + SHIFT_KEY));
		}
		return encryptedText.toString();
	}

	/**
	 * decrypt text
	 **/
	public static String decrypt(String encryptedText) {
		StringBuilder text = new StringBuilder();
		for (char c : encryptedText.toCharArray()) {
			text.append((char) (c - SHIFT_KEY));
		}
		return text.toString();
	}
}
